<?php
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2020/6/15
 * Time: 21:37
 */

namespace App\Logic;


use App\Model\AppModel;
use App\Services\ReponseCodeService;

class AppLogic
{
    /**
     * @param $accessKey
     * @return array|bool|null
     */
    public function findByAccessKey($accessKey){
        try{
            return AppModel::create()->get(['access_key'=>$accessKey]);
        }catch(\Throwable $t){
            return ReponseCodeService:: CODE_SERVICE_UNAVAILABLE;
        }
    }
}